<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script type="text/javascript">
	$(function() {
		
		$('#mamProductEditForm').form({
			url : '${ctx}/mamProduct/edit',
			onSubmit : function() {
				progressLoad();
				var isValid = $(this).form('validate');
				if (!isValid) {
					progressClose();
				}
				return isValid;
			},
			success : function(result) {
				progressClose();
				result = $.parseJSON(result);
				if (result.success) {
					parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
					parent.$.modalDialog.handler.dialog('close');
				} else {
					parent.$.messager.alert('错误', result.msg, 'error');
				}
			}
		});
		if(${mamProduct.isEnable}){
			$("#isEnable").val(1);
		}else{
			$("#isEnable").val(0);
		}
		
		
	});
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',border:false" title="" style="overflow: hidden;padding: 3px;">
		<form id="mamProductEditForm" method="post">
			<table class="grid">
           <input name="id" type="hidden"  value="${mamProduct.id}">
				<tr>
					<td>产品</td>
					<td><input name="maProduct" type="text" placeholder="请输入产品" class="easyui-validatebox"  value="${mamProduct.maProduct}"></td>
				</tr>
				<tr>
					<td>说明</td>
					<td><input name="maName" type="text" placeholder="请输入说明" class="easyui-validatebox"  value="${mamProduct.maName}"></td>
				</tr>
				<tr>
					<td>短连接</td>
					<td><input name="maUrl" type="text" placeholder="请输入短连接" class="easyui-validatebox"  value="${mamProduct.maUrl}"></td>
				</tr>
				<tr>
					<td>二维码</td>
					<td><input name="maQrCode" type="text" placeholder="请输入二维码" class="easyui-validatebox"  value="${mamProduct.maQrCode}"></td>
				</tr>
				<tr>
					<td>淘口令</td>
					<td><input name="maPwd" type="text" placeholder="请输入淘口令" class="easyui-validatebox"  value="${mamProduct.maPwd}"></td>
				</tr>
				<tr>
					<td>是否启用</td>
					<td>
						<select id="isEnable" name="isEnable" class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
							<option value="1">是</option>
							<option value="0">否</option>
						</select>
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>
